Skip to content

feat: support iOS source-map uploads#871

Open
ablaszkiewicz wants to merge 14 commits into
mainfrom
ab/feat/ios-source-maps
Open

feat: support iOS source-map uploads#871
ablaszkiewicz wants to merge 14 commits into
mainfrom
ab/feat/ios-source-maps

Conversation

@ablaszkiewicz

@ablaszkiewicz ablaszkiewicz commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for iOS source maps. Tested both CocoaPods and SPM (Swift Package Manager) approaches. I assume that iOS devs are using xcode so this is xcode focused. As a result of this wizard run you literally press "play" in xcode and EVERYTHING works!

CocoaPods SPM
image CleanShot 2026-07-15 at 20 32 13

Also experienced a bug where agent tried creating some crazy directory tree and put .env file in it. Hardened that part

Companion PRs

@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

ablaszkiewicz and others added 13 commits July 14, 2026 18:27
Native iOS never loads a .env at build time, so the personal API key the
dSYM upload needs was being written to a file Xcode ignores. Route it
through a gitignored xcconfig instead:

- set_env_values writes Xcode `KEY = VALUE` style (and gitignores the file)
  when the target path ends in .xcconfig, reusing the existing secret-vault
  resolution so the key never reaches the agent.
- The source-maps prompt branches on the iOS variant: secret to
  PostHog.xcconfig, non-secret project id / host as export lines in the
  dSYM-upload Run Script build phase.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
POSTHOG_CLI_HOST was interpolated from ctx.host — the SDK/ingestion host
(us.i.posthog.com) — so generated build phases and .env files pointed
posthog-cli at a host that does not serve the upload API. Use the uiHost
the prompt already derives (us.posthog.com), in both the iOS xcconfig
branch and the dotenv branch, and tell the agent explicitly never to
copy the *.i.posthog.com host out of SDK setup code.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The generic test-done template bakes CLI build/run commands, so iOS runs
mixed xcodebuild with Xcode GUI steps and imported debugger-detach /
relaunch steps from the crash-testing docs — the test captures an
exception event, not a crash. iOS now gets a fixed three-step Xcode
script: set Run configuration to Release, run, tap, check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two live runs in a row generated the upload phase without the prefix —
symbols uploaded, source never did ('frame resolved but no source
context'). The skill snippet alone doesn't hold; make it a wizard-side
MUST tied to the symptom.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
All three POSTHOG_CLI_* values go in the gitignored xcconfig — the host
written as https:/$()/… so // doesn't start an xcconfig comment. One
set_env_values call replaces the secret-write + phase-exports split, and
the prompt sheds the fallback/host-warning prose the skill now owns.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Agents dropped the command-line prefix in three consecutive runs. Build
settings export to Run Script environments, so the flag lives in the
xcconfig with the other values — the phase invocation has nothing left
to drop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The SDK's upload-symbols.sh now accepts POSTHOG_DOTENV_FILE and forwards
it to posthog-cli --dotenv-file, so iOS joins the standard gitignored
.env flow. Drops the xcconfig assignment style from set_env_values and
the iOS-specific credential branch from the source-maps prompt; the
Xcode-based test instructions remain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…oudly

An agent running in a project nested inside a larger git repo prefixed
set_env_values' filePath with the project's repo-relative location, and
the tool silently mkdir'd a duplicate nested tree for the .env. Refuse
to create missing parent directories (with an instructive error), spell
out the resolution base in both tools' filePath descriptions, and stop
calling the project directory 'the repo root' in the source-maps prompt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The STEP 8 test-done wizard_ask hardcoded a CLI build/run template plus
an isIos-gated Xcode variant. The skill's "Identify the build and run
commands" and "Test the local setup" steps already carry the
per-platform flow (Xcode Release run, gradle, react-native CLI), so the
prompt now composes steps 1-2 from STEP 6's skill-resolved flow and
keeps only the invariants: numbered copy-pasteable steps, the Error
Tracking check, the Continue-and-revert contract. Enabling Android or
React Native later is a context-mill skill change, not a prompt edit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reverts the skill-delegation rewrite (605f602) — the pinned template
text stays exactly as before — and moves the inline isIos ternary into
TEST_DONE_PROMPT_OVERRIDES, a Partial<Record<SkillVariant, ...>> keyed
by variant. Supporting android or react-native later means adding an
entry; the prompt body no longer branches on platform.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ablaszkiewicz ablaszkiewicz marked this pull request as ready for review July 15, 2026 18:51
@ablaszkiewicz ablaszkiewicz requested review from a team as code owners July 15, 2026 18:51
@ablaszkiewicz ablaszkiewicz requested review from cat-ph, Copilot and hpouillot and removed request for Copilot July 15, 2026 18:51

@gewenyu99 gewenyu99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks mostly fine, but I want to discuss the override context.

Is it truly something that should live here, or is it time to create variants of this in the context mill?

Image

* platform (android, react-native, …) means adding an entry — the prompt
* body stays untouched.
*/
const TEST_DONE_PROMPT_OVERRIDES: Partial<

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these stay here or as "variants" in the context mill?

I'm a little worried that this shape is quickly turning from exceptions to shipping context in wizard instead of skills

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants